package com.app.mapper;

import com.app.entity.Blog;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.ArrayList;

@Mapper
public interface BlogMapper {
    @Select("SELECT * FROM blog")
    ArrayList<Blog> getAllBlog();

    @Insert("INSERT INTO blog(title,content,categories,author) VALUES(#{title},#{content},#{categories},#{author})")
    boolean addBlog(String title,String content,String categories,String author);

    @Select("SELECT * FROM blog WHERE id = #{id}")
    Blog getBlog(String id);
}
